**Replication data of "Can Activation of a Shared Identity Increase Cooperation Between Natives and Migrants?"

global demo_control "s2_q10 s2_q11 s2_q12 s2_q13 i.s2_q18 s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk" 


	*****************************************
	**** Tables and figures in the body*****
	*****************************************

	*** Figure 1
	*Note: significance indicators are manually generated, based on ttest results. 
	
	* comparison of South Koreans' peceptions regarding economic status of SK, NK, and CK
	clear 
	use "koreanproject_wide.dta"
	drop if sub_korean_group!=1
	ttest s1_q19_4 = s1_q21_4 
	ttest s1_q19_4 = s1_q20_4 
	ttest s1_q20_4 = s1_q21_4	
	graph bar s1_q19_4 s1_q21_4 s1_q20_4, asyvars bargap(2) bar(1, fcolor(gs2) lcolor(gs2)) bar(2, fcolor(gs7) lcolor(gs7)) bar(3, fcolor(gs12) lcolor(gs12)) xsize(4) ysize(4) scale(0.8) graphregion(color(white)) title("Positive feelings", color(black) size(medium)) ytitle("Group mean") yscale(r(0 (1) 3)) ylabel(0(1)3, angle(0) labsize(small)) legend(order(1 "South Koreans" 2 "North Koreans" 3 "Chinese Koreans")  col(3) size(small)) saving(comp_economic_status, replace)

	* positive feelings
	ttest s1_q3_sk = s1_q3_nk_in_sk
	ttest s1_q3_sk = s1_q3_ck
	ttest s1_q3_nk_in_sk= s1_q3_ck	
	graph bar s1_q3_sk s1_q3_nk_in_sk s1_q3_ck, asyvars bargap(2) bar(1, fcolor(gs2) lcolor(gs2)) bar(2, fcolor(gs7) lcolor(gs7)) bar(3, fcolor(gs12) lcolor(gs12)) xsize(4) ysize(4) scale(0.8) graphregion(color(white)) title("Positive feelings", color(black) size(medium)) ytitle("Group mean") yscale(r(0 (20) 100)) ylabel(0(20)100, angle(0) labsize(small)) legend(order(1 "South Koreans" 2 "North Koreans" 3 "Chinese Koreans")  col(3) size(small)) saving(south_koreans_positive_feeling, replace)

	* prejudice
	ttest s1_q5_prejudice_sk = s1_q7_prejudice_nk
	ttest s1_q5_prejudice_sk = s1_q6_prejudice_ck
	ttest s1_q7_prejudice_nk = s1_q6_prejudice_ck
	graph bar s1_q5_prejudice_sk s1_q7_prejudice_nk s1_q6_prejudice_ck, asyvars bargap(2) bar(1, fcolor(gs2) lcolor(gs2)) bar(2, fcolor(gs7) lcolor(gs7)) bar(3, fcolor(gs12) lcolor(gs12)) xsize(4) ysize(4) scale(0.8) graphregion(color(white)) title("Group prejudice", color(black) size(medium)) ytitle("Group mean") yscale(r(0 (1) 3)) ylabel(0(1)3, angle(0) labsize(small)) legend(order(1 "South Koreans" 2 "North Koreans" 3 "Chinese Koreans")  col(3) size(small)) saving(south_koreans_prejudice, replace)
			
	* attachedment to south korea
	ttest s1_q19_1 = s1_q21_1
	ttest s1_q19_1 = s1_q20_1
	ttest s1_q21_1 = s1_q20_1	
	graph bar s1_q19_1 s1_q21_1 s1_q20_1, asyvars bargap(2) bar(1, fcolor(gs2) lcolor(gs2)) bar(2, fcolor(gs7) lcolor(gs7)) bar(3, fcolor(gs12) lcolor(gs12)) xsize(4) ysize(4) scale(0.8) graphregion(color(white)) title("Belief about attachment to South Korea", color(black) size(medium)) ytitle("Group mean") yscale(r(0 (1) 3)) ylabel(0(1)3, angle(0) labsize(small)) legend(order(1 "South Koreans" 2 "North Koreans" 3 "Chinese Koreans")  col(3) size(small)) saving(south_koreans_belief_attachment, replace)

	gen nk_socio_economic_status = (s1_q21_3 + s1_q21_4)/2
	gen ck_socio_economic_status = (s1_q20_3 + s1_q20_4)/2	
	ttest nk_socio_economic_status = ck_socio_economic_status

	grc1leg comp_economic_status.gph south_koreans_positive_feeling.gph south_koreans_prejudice.gph south_koreans_belief_attachment.gph, legendfrom(south_koreans_positive_feeling.gph) col(2)


	* Table 3. 
	* Panel 1: Regression result in the other-other allocation game (Task 1)
	clear 
	use "koreanproject_wide.dta"
	reg allocation_outgroup i.video i.team if discussion==0, cluster(team_id)
	estimates store model1				
	reg allocation_outgroup i.video i.team $demo_control i.sub_korean_group i.session_chinese_korean   if discussion==0, cluster(team_id)
	estimates store model2	
	reg allocation_outgroup i.discussion i.team if video==1, cluster(team_id)
	estimates store model3
	reg allocation_outgroup i.discussion i.team $demo_control i.sub_korean_group i.session_chinese_korean if video==1, cluster(team_id)
	estimates store model4
	esttab model1 model2 model3 model4 using "table3_task1.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	* Panel 2: Regression result in the trust game (Task 2)
	clear 
	use "koreanproject_wide.dta"
	reg trust_outgroup i.video i.team if discussion==0, cluster(team_id)
	estimates store model1
	reg trust_outgroup i.video i.team $demo_control i.sub_korean_group i.session_chinese_korean  if discussion==0, cluster(team_id)
	estimates store model2
	reg trust_outgroup i.discussion i.team if video==1, cluster(team_id)
	estimates store model3	
	reg trust_outgroup i.discussion i.team $demo_control i.sub_korean_group i.session_chinese_korean if video==1, cluster(team_id)
	estimates store model4	
	esttab model1 model2 model3 model4 using "table3_task2.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	* Panel 3. Regression result in the public goods game (Task 3)
	clear
	use "koreanproject_long.dta"	
	xtset numeric_subject_id round 	
	xtreg contribution i.video i.team lagged_contribution if discussion==0, cluster(team_id)
	estimates store model1	
	xtreg contribution i.video i.team lagged_contribution $demo_control i.sub_korean_group i.session_chinese_korean if discussion==0, cluster(team_id)
	estimates store model2		
	xtreg contribution i.discussion i.team lagged_contribution if video==1, cluster(team_id)
	estimates store model3
	xtreg contribution i.discussion i.team lagged_contribution $demo_control i.sub_korean_group i.session_chinese_korean if video==1, cluster(team_id)
	estimates store model4
	esttab model1 model2 model3 model4 using "table3_task3.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
		
	
	**** Figure 2: Regression results are reported in Appendix L

	*** SK-NK
	* Task 1
	clear 
	use "koreanproject_wide.dta"
	drop if discussion==1
	gen treatment = video
	reg allocation_outgroup i.treatment i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	estimates store model1 
	reg allocation_outgroup i.treatment##i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	margins, dydx(treatment) at(north_korean=(0(1)1)) post
	estimates store model2
	
	clear 
	use "koreanproject_wide.dta"
	drop if video==0
	gen treatment = discussion
	reg allocation_outgroup i.treatment i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	estimates store model3	
	reg allocation_outgroup i.treatment##i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	margins, dydx(treatment) at(north_korean=(0(1)1)) post
	estimates store model4		
	
	* Task 2
	clear 
	use "koreanproject_wide.dta"
	drop if discussion==1
	gen treatment = video
	reg trust_outgroup i.treatment i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	estimates store model5 
	reg trust_outgroup i.treatment##i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	margins, dydx(treatment) at(north_korean=(0(1)1)) post
	estimates store model6

	clear 
	use "koreanproject_wide.dta"
	drop if video==0
	gen treatment = discussion
	reg trust_outgroup i.treatment i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	estimates store model7	
	reg trust_outgroup i.treatment##i.north_korean i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	margins, dydx(treatment) at(north_korean=(0(1)1)) post	
	estimates store model8	
	
	* Task 3
	clear
	use "koreanproject_long.dta"
	xtset numeric_subject_id round 
	drop if discussion==1
	gen treatment = video	
	xtreg contribution i.treatment i.north_korean lagged_contribution i.team $demo_control  if session_chinese_korean==0, cluster(team_id)
	estimates store model9
	xtreg contribution i.treatment##i.north_korean lagged_contribution i.team $demo_control  if session_chinese_korean==0, cluster(team_id)
	margins, dydx(treatment) at(north_korean=(0(1)1)) post
	estimates store model10

	clear
	use "koreanproject_long.dta"
	xtset numeric_subject_id round 
	drop if video==0
	gen treatment = discussion
	xtreg contribution i.treatment i.north_korean lagged_contribution i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	estimates store model11
	xtreg contribution i.treatment##i.north_korean lagged_contribution i.team $demo_control if session_chinese_korean==0, cluster(team_id)
	margins, dydx(treatment) at(north_korean=(0(1)1)) post	
	estimates store model12
	
	coefplot (model1, msymbol(S) mcolor(gs0) mlabcolor(gs0) ciopts(lcol(gs0)) offset(0.15)) (model3, msymbol(O) mcolor(gs7) mlabcolor(gs7) ciopts(lcol(gs7)) offset(-0.15)) (model2, msymbol(S) mcolor(gs0) mlabcolor(gs0) ciopts(lcol(gs0)) offset(0.15)) (model4, msymbol(O) mcolor(gs7) mlabcolor(gs7) ciopts(lcol(gs7)) offset(-0.15)) || model5 model7 model6 model8 || model9 model11 model10 model12, drop(*.team *.s2_q18 1.north_korean $demo_control lagged_contribution _cons) coeflabels(1.treatment =Overall 1._at ="South Korean" 2._at="North Korean") xline(0) plotlabels("A" "B") bylabels("Other-Other Allocation Game (Task 1)" "Trust Game (Task 2)" "Public Goods Game (Task 3)") mlabel format(%9.2g) mlabposition(12) mlabgap(*2) xsize(5) ysize(2) xscale(range(-2 2)) byopts(cols(3) legend(off)) saving(figure2_upper, replace) 

	
	*** SK-CK
	* Task 1
	clear 
	use "koreanproject_wide.dta"
	drop if discussion==1
	gen treatment = video
	reg allocation_outgroup i.treatment i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	estimates store model1 
	reg allocation_outgroup i.treatment##i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	margins, dydx(treatment) at(chinese_korean=(0(1)1)) post
	estimates store model2
	
	clear 
	use "koreanproject_wide.dta"
	drop if video==0
	gen treatment = discussion
	reg allocation_outgroup i.treatment i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	estimates store model3	
	reg allocation_outgroup i.treatment##i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	margins, dydx(treatment) at(chinese_korean=(0(1)1)) post
	estimates store model4		
	
	* Task 2
	clear 
	use "koreanproject_wide.dta"
	drop if discussion==1
	gen treatment = video
	reg trust_outgroup i.treatment i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	estimates store model5 
	reg trust_outgroup i.treatment##i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	margins, dydx(treatment) at(chinese_korean=(0(1)1)) post
	estimates store model6

	clear 
	use "koreanproject_wide.dta"
	drop if video==0
	gen treatment = discussion	
	reg trust_outgroup i.treatment i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	estimates store model7	
	reg trust_outgroup i.treatment##i.chinese_korean i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	margins, dydx(treatment) at(chinese_korean=(0(1)1)) post	
	estimates store model8	
	
	* Task 3
	clear
	use "koreanproject_long.dta"
	xtset numeric_subject_id round 
	drop if discussion==1
	gen treatment = video	
	xtreg contribution i.treatment i.chinese_korean lagged_contribution i.team $demo_control  if session_chinese_korean==1, cluster(team_id)
	estimates store model9
	xtreg contribution i.treatment##i.chinese_korean lagged_contribution i.team $demo_control  if session_chinese_korean==1, cluster(team_id)
	margins, dydx(treatment) at(chinese_korean=(0(1)1)) post
	estimates store model10

	clear
	use "koreanproject_long.dta"
	xtset numeric_subject_id round 
	drop if video==0
	gen treatment = discussion
	xtreg contribution i.treatment i.chinese_korean lagged_contribution i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	estimates store model11
	xtreg contribution i.treatment##i.chinese_korean lagged_contribution i.team $demo_control if session_chinese_korean==1, cluster(team_id)
	margins, dydx(treatment) at(chinese_korean=(0(1)1)) post	
	estimates store model12
	
	coefplot (model1, msymbol(S) mcolor(gs0) mlabcolor(gs0) ciopts(lcol(gs0)) offset(0.15)) (model3, msymbol(O) mcolor(gs7) mlabcolor(gs7) ciopts(lcol(gs7)) offset(-0.15)) (model2, msymbol(S) mcolor(gs0) mlabcolor(gs0) ciopts(lcol(gs0)) offset(0.15)) (model4, msymbol(O) mcolor(gs7) mlabcolor(gs7) ciopts(lcol(gs7)) offset(-0.15)) || model5 model7 model6 model8 || model9 model11 model10 model12, drop(*.team *.s2_q18 1.chinese_korean $demo_control lagged_contribution _cons) coeflabels(1.treatment =Overall 1._at ="South Korean" 2._at="Chinese Korean") xline(0) plotlabels("A" "B") bylabels("Other-Other Allocation Game (Task 1)" "Trust Game (Task 2)" "Public Goods Game (Task 3)") mlabel format(%9.2g) mlabposition(12) mlabgap(*2) xsize(5) ysize(2) xscale(range(-2 2)) byopts(cols(3) legend(off)) saving(figure2_lower, replace) legend(off) 
	
	graph combine figure2_upper.gph figure2_lower.gph, col(1)		
	

	
	****************************************
	***Online supplementary materials ******
	****************************************
	
	***Appendix C: Moderator evaluation*****
	clear
	use "koreanproject_wide.dta"
	drop if moderator_1 == .
	keep session team_id exp_condition session_chinese_korean manipulation discussion  moderator_1 moderator_2 moderator_3 moderator_4 moderator_5 moderator_6 moderator_7 moderator_8
	
	** Since one moderator's evaluation is applied to all his/her team member, we need only one observation
	bysort team_id: keep if _n==1
	
	tab session_chinese_korean moderator_1
	tab session_chinese_korean moderator_2
	tab session_chinese_korean moderator_3
	tab session_chinese_korean moderator_4	
	tab session_chinese_korean moderator_5
	tab session_chinese_korean moderator_6
	tab session_chinese_korean moderator_7
	tab session_chinese_korean moderator_8	

	oneway moderator_1 session_chinese_korean, tabulate
	oneway moderator_2 session_chinese_korean, tabulate
	oneway moderator_3 session_chinese_korean, tabulate
	oneway moderator_4 session_chinese_korean, tabulate
	oneway moderator_5 session_chinese_korean, tabulate
	oneway moderator_6 session_chinese_korean, tabulate
	oneway moderator_7 session_chinese_korean, tabulate
	oneway moderator_8 session_chinese_korean, tabulate
	
	clear
	use "koreanproject_wide.dta"
	gen uncomfortable = moderator_1
	replace uncomfortable = 3 if moderator_2 == 2
	tab  uncomfortable 
	gen sk_dominance = moderator_3
	gen men_domiance = 4 - moderator_4
	gen old_domiance = 4 - moderator_5
	gen reference_video = moderator_6
	gen tension = moderator_7
	gen constructive = moderator_8
	
	reg allocation_outgroup uncomfortable sk_dominance men_domiance old_domiance reference_video tension constructive $demo_control i.sub_korean_group i.session_chinese_korean if discussion==1, cluster(team_id)	
	estimates store model1
	reg trust_outgroup uncomfortable sk_dominance men_domiance old_domiance reference_video tension constructive $demo_control i.sub_korean_group i.session_chinese_korean if discussion==1, cluster(team_id)	
	estimates store model2	
	esttab model1 model2 using "moderator_survey_1.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	clear
	use "koreanproject_long.dta"		
	gen uncomfortable = moderator_1
	replace uncomfortable = 3 if moderator_2 == 2
	tab  uncomfortable 	
	gen sk_dominance = moderator_3
	gen men_domiance = 4 - moderator_4
	gen old_domiance = 4 - moderator_5
	gen reference_video = moderator_6
	gen tension = moderator_7
	gen constructive = moderator_8
	
	xtset numeric_subject_id round 
	xtreg contribution uncomfortable sk_dominance men_domiance old_domiance reference_video tension constructive lagged_contribution $demo_control i.sub_korean_group i.session_chinese_korean if discussion==1, cluster(team_id)	
	estimates store model3	
	
	esttab model3 using "moderator_survey_2.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
		
	
	* Appendix D: Graphical display of minimum detectable effect sizes according to power variation
	power twomeans 0, power(0.60(0.05)0.95) n(336) table(power:"Power" delta:"Effect size" diff:"Diff", formats(power "%9.0g")) graph 
	graph save power_graph_h1_h2.gph, replace
	power twomeans 0, power(0.60(0.05)0.95) n(168) table(power:"Power" delta:"Effect size" diff:"Diff", formats(power "%9.0g")) graph 
	graph save power_graph_h3_h4.gph, replace
	graph combine power_graph_h1_h2.gph power_graph_h3_h4.gph, col(1)

	
	* Appendix G. Comparison of South Korean participants to respondents in the 2018 General Social Survey
	clear 
	use "KGSS2018.dta"
	append using "koreanproject_wide.dta"
	generate sample_type =.
	replace sample_type = 0 if YEAR==2018
	replace sample_type = 1 if session>0 & session<13
	tab sample_type
	
	*age comparison
	replace AGE=. if AGE<0
	tab AGE
	twoway kdensity AGE if sample_type==0, bwidth(10) lcolor(gs0) || kdensity s2_q10 if sample_type==1, bwidth(10) lcolor(gs0) clpattern(shortdash) ytitle("kdensity", size(small)) ylab(, labsize(small)) xtitle("Age", size(small)) legend(col(3) label(1 "KGSS2018 (1030 participants)") label(2 "Experiment (252 SK participants)") size(small)) graphregion(color(white)) saving(comp_age, replace)

	*education comparison
	replace EDUC=. if EDUC<0
	replace EDUC=0 if EDUC==8
	recode EDUC (4/5=4) (6/7=5)
	tab EDUC
	twoway kdensity EDUC if sample_type==0, bwidth(1) lcolor(gs0) || kdensity s2_q13 if sample_type==1, bwidth(1) lcolor(gs0) clpattern(shortdash) ytitle("kdensity", size(small)) ylab(, labsize(small)) xtitle("Education", size(small)) legend(col(3) label(1 "KGSS2018 (1030 participants)") label(2 "Experiment (249 SK participants)") size(small)) graphregion(color(white)) saving(comp_edu, replace)

	*income comparison
	recode INCOME (-8=.) (0/3=0) (4/6=1) (7/9=2) (10/12=3) (13/15=4) (16/18=5) (19/21=6)
	tab INCOME
	twoway kdensity INCOME if sample_type==0, bwidth(1) lcolor(gs0) || kdensity s2_q12 if sample_type==1, bwidth(1) lcolor(gs0) clpattern(shortdash) ytitle("kdensity", size(small)) ylab(, labsize(small)) xtitle("Household monthly income", size(small)) legend(col(3) label(1 "KGSS2018 (895 participants)") label(2 "Experiment (249 SK participants)") size(small)) graphregion(color(white)) saving(comp_income, replace)
	
	graph combine comp_age.gph comp_edu.gph comp_income.gph, col(1)
	

	*Appendix H: Randomization checks 	
	clear 
	use "koreanproject_wide.dta"	
	reg video s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==1 & discussion!=1
	estimates store model1
	reg discussion s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==1 & video!=0
	estimates store model2
	reg session_chinese_korean s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==1	
	estimates store model3
	reg video s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==2 & discussion!=1
	estimates store model4
	reg discussion s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==2  & video!=0
	estimates store model5
	reg video s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==3 & discussion!=1
	estimates store model6
	reg discussion s2_q10 s2_q11 s2_q12 s2_q13 s2_q18_job s1_q18 s1_q5_prejudice_sk s1_q6_prejudice_ck s1_q7_prejudice_nk if sub_korean_group==3  & video!=0
	estimates store model7
	esttab model1 model2 model3 model4 model5 model6 model7 using "balance_test.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	

	*Appendix J: Simple comparison of outcome 
	clear
	use "koreanproject_wide.dta"
	gen exp_condition_2 = 0 if video == 0 & discussion == 0
	replace exp_condition_2 = 1 if video == 1 & discussion == 0
	replace exp_condition_2 = 2 if video == 1 & discussion == 1	

	tabstat allocation_outgroup, stat(N mean sd) by(exp_condition_2)
	tabstat allocation_outgroup if south_korean == 1 & session_chinese_korean ==0, stat(N mean sd) by(exp_condition_2)	
	tabstat allocation_outgroup if north_korean == 1 & session_chinese_korean ==0, stat(N mean sd) by(exp_condition_2)	
	tabstat allocation_outgroup if south_korean == 1 & session_chinese_korean ==1, stat(N mean sd) by(exp_condition_2)	
	tabstat allocation_outgroup if chinese_korean == 1 & session_chinese_korean ==1, stat(N mean sd) by(exp_condition_2)	
		
	tabstat trust_outgroup, stat(N mean sd) by(exp_condition_2)	
	tabstat trust_outgroup if south_korean == 1 & session_chinese_korean ==0, stat(N mean sd) by(exp_condition_2)	
	tabstat trust_outgroup if north_korean == 1 & session_chinese_korean ==0, stat(N mean sd) by(exp_condition_2)	
	tabstat trust_outgroup if south_korean == 1 & session_chinese_korean ==1, stat(N mean sd) by(exp_condition_2)	
	tabstat trust_outgroup if chinese_korean == 1 & session_chinese_korean ==1, stat(N mean sd) by(exp_condition_2)	
	
	clear
	use "koreanproject_long.dta"	
	gen exp_condition_2 = 0 if video == 0 & discussion == 0
	replace exp_condition_2 = 1 if video == 1 & discussion == 0
	replace exp_condition_2 = 2 if video == 1 & discussion == 1	
	
	tabstat contribution, stat(N mean sd) by(exp_condition_2)
	tabstat contribution if south_korean == 1 & session_chinese_korean ==0, stat(N mean sd) by(exp_condition_2)	
	tabstat contribution if north_korean == 1 & session_chinese_korean ==0, stat(N mean sd) by(exp_condition_2)	
	tabstat contribution if south_korean == 1 & session_chinese_korean ==1, stat(N mean sd) by(exp_condition_2)	
	tabstat contribution if chinese_korean == 1 & session_chinese_korean ==1, stat(N mean sd) by(exp_condition_2)		
		
		
	** Appendix K: Pattern of contributions in the public goods game across five rounds 	
	clear
	use "koreanproject_long.dta"	
	xtset numeric_subject_id round 
	xtgraph contribution, group(exp_condition) av(am) bar(ci) t(round) offset(0.1)
	*symbols are added using editing on the plot

	
	
	
	********** Appendix M. Understanding of the behaivoral games
	use "koreanproject_wide.dta", clear
	ttest s2_q1_understanding if sub_korean_group<3, by(sub_korean_group)
	ttest s2_q1_understanding if sub_korean_group>1, by(sub_korean_group)
	ttest s2_q1_understanding if sub_korean_group!=2, by(sub_korean_group)
	oneway s2_q1_understanding exp_condition
	oneway s2_q1_understanding manipulation 
	graph bar s2_q1_understanding, over(sub_korean_group)
	
	* Panel 1: Regression result in the other-other allocation game (Task 1)
	clear 
	use "koreanproject_wide.dta"
	reg allocation_outgroup i.video s2_q1_understanding i.team $demo_control i.sub_korean_group  if discussion==0 & sub_korean_group != 1, cluster(team_id)
	estimates store model1
	reg allocation_outgroup i.video##c.s2_q1_understanding i.team $demo_control i.sub_korean_group  if discussion==0 & sub_korean_group != 1, cluster(team_id)
	estimates store model2
	margins, dydx(video) at(s2_q1_understanding=(0(1)3)) post		
	marginsplot, yline(0)
	reg allocation_outgroup i.discussion s2_q1_understanding i.team $demo_control i.sub_korean_group if video==1 & sub_korean_group != 1, cluster(team_id)
	estimates store model3	
	reg allocation_outgroup i.discussion##c.s2_q1_understanding i.team $demo_control i.sub_korean_group if video==1 & sub_korean_group != 1, cluster(team_id)
	estimates store model4
	margins, dydx(discussion) at(s2_q1_understanding=(0(1)3)) post		
	marginsplot, yline(0)
	esttab model1 model2 model3 model4 using "understanding_task1.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
		
	* Panel 2: Regression result in the trust game (Task 2)
	clear 
	use "koreanproject_wide.dta"	
	reg trust_outgroup i.video s2_q1_understanding i.team $demo_control i.sub_korean_group if discussion==0 & sub_korean_group != 1, cluster(team_id)
	estimates store model1
	reg trust_outgroup i.video##c.s2_q1_understanding i.team $demo_control i.sub_korean_group if discussion==0 & sub_korean_group != 1, cluster(team_id)
	estimates store model2
	margins, dydx(video) at(s2_q1_understanding=(0(1)3)) post		
	marginsplot, yline(0)	
	reg trust_outgroup i.discussion s2_q1_understanding i.team $demo_control i.sub_korean_group if video==1 & sub_korean_group != 1, cluster(team_id)
	estimates store model3
	reg trust_outgroup i.discussion##c.s2_q1_understanding i.team $demo_control i.sub_korean_group if video==1 & sub_korean_group != 1, cluster(team_id)
	estimates store model4
	margins, dydx(discussion) at(s2_q1_understanding=(0(1)3)) post		
	marginsplot, yline(0)		
	esttab model1 model2 model3 model4 using "understanding_task2.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	* Panel 3. Regression result in the public goods game (Task 3)
	clear
	use "koreanproject_long.dta"
	xtset numeric_subject_id round 
	xtreg contribution i.video s2_q1_understanding i.team lagged_contribution $demo_control i.sub_korean_group if discussion==0 & sub_korean_group != 1, cluster(team_id)
	estimates store model1	
	xtreg contribution i.video##c.s2_q1_understanding i.team lagged_contribution $demo_control i.sub_korean_group if discussion==0 & sub_korean_group != 1, cluster(team_id)
	estimates store model2	
	margins, dydx(video) at(s2_q1_understanding=(0(1)3)) post		
	marginsplot, yline(0)
	xtreg contribution i.discussion s2_q1_understanding i.team lagged_contribution $demo_control i.sub_korean_group if video==1 & sub_korean_group != 1, cluster(team_id)
	estimates store model3
	xtreg contribution i.discussion##c.s2_q1_understanding i.team lagged_contribution $demo_control i.sub_korean_group if video==1 & sub_korean_group != 1, cluster(team_id)
	estimates store model4
	margins, dydx(discussion) at(s2_q1_understanding=(0(1)3)) post		
	marginsplot, yline(0)
	esttab model1 model2 model3 model4 using "understanding_task3.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	
	

	**** Appendix N: Regression on the effect of dual identity ****

	* Panel 1: Regression result in the other-other allocation game (Task 1)
	clear 
	use "koreanproject_wide.dta"
	gen str_dual_identity = .
	replace str_dual_identity = s1_q3_nk_in_sk - s1_q3_sk  if north_korean == 1
	replace str_dual_identity = s1_q3_ck - s1_q3_sk if chinese_korean == 1	
	ttest str_dual_identity if south_korean == 0, by(chinese_korean)
	histogram str_dual_identity if south_korean == 0, by (chinese_korean) width(10) xla(-100(20)100) percent
	
	reg allocation_outgroup i.video c.str_dual_identity i.team $demo_control i.session_chinese_korean   if discussion==0& south_korean == 0, cluster(team_id)
	estimates store model1		
	reg allocation_outgroup i.video##c.str_dual_identity i.team $demo_control i.session_chinese_korean   if discussion==0& south_korean == 0, cluster(team_id)
	estimates store model2
	margins, dydx(video) at(str_dual_identity= (-95(10)70))
	marginsplot, yline(0)
	reg allocation_outgroup i.discussion c.str_dual_identity i.team $demo_control i.session_chinese_korean if video==1& south_korean == 0, cluster(team_id)
	estimates store model3
	reg allocation_outgroup i.discussion##c.str_dual_identity i.team $demo_control  i.session_chinese_korean if video==1& south_korean == 0, cluster(team_id)
	estimates store model4
	margins, dydx(discussion) at(str_dual_identity= (-95(10)70))
	marginsplot, yline(0)
	esttab model1 model2 model3 model4 using "appendix_n_task1_dual.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	* Panel 2: Regression result in the trust game (Task 2)
	clear 
	use "koreanproject_wide.dta"
	gen str_dual_identity = .
	replace str_dual_identity = s1_q3_nk_in_sk - s1_q3_sk  if north_korean == 1
	replace str_dual_identity = s1_q3_ck - s1_q3_sk if chinese_korean == 1	
	ttest str_dual_identity if south_korean == 0, by(chinese_korean)
	
	reg trust_outgroup i.video c.str_dual_identity i.team $demo_control i.session_chinese_korean  if discussion==0& south_korean == 0, cluster(team_id)
	estimates store model1
	reg trust_outgroup i.video##c.str_dual_identity i.team $demo_control i.session_chinese_korean  if discussion==0& south_korean == 0, cluster(team_id)
	estimates store model2
	margins, dydx(video) at(str_dual_identity= (-95(10)70))
	marginsplot, yline(0)
	reg trust_outgroup i.discussion c.str_dual_identity i.team $demo_control i.session_chinese_korean if video==1& south_korean == 0, cluster(team_id)
	estimates store model3
	reg trust_outgroup i.discussion##c.str_dual_identity i.team $demo_control i.session_chinese_korean if video==1& south_korean == 0, cluster(team_id)
	estimates store model4
	margins, dydx(discussion) at(str_dual_identity= (-95(10)70))
	marginsplot, yline(0)
	esttab model1 model2 model3 model4 using "appendix_n_task2_dual.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
	* Panel 3. Regression result in the public goods game (Task 3)
	clear
	use "koreanproject_long.dta"
	gen str_dual_identity = .
	replace str_dual_identity = s1_q3_nk_in_sk - s1_q3_sk  if north_korean == 1
	replace str_dual_identity = s1_q3_ck - s1_q3_sk if chinese_korean == 1	
	ttest str_dual_identity if south_korean == 0, by(chinese_korean)
	
	xtset numeric_subject_id round 	
	xtreg contribution i.video c.str_dual_identity i.team lagged_contribution $demo_control i.session_chinese_korean if discussion==0& south_korean == 0, cluster(team_id)
	estimates store model1	
	xtreg contribution i.video##c.str_dual_identity i.team lagged_contribution $demo_control i.session_chinese_korean if discussion==0& south_korean == 0, cluster(team_id)
	estimates store model2	
	margins, dydx(video) at(str_dual_identity= (-95(10)70))
	marginsplot, yline(0)	
	xtreg contribution i.discussion c.str_dual_identity i.team lagged_contribution $demo_control i.session_chinese_korean if video==1& south_korean == 0, cluster(team_id)
	estimates store model3
	xtreg contribution i.discussion##c.str_dual_identity i.team lagged_contribution $demo_control i.session_chinese_korean if video==1& south_korean == 0, cluster(team_id)
	estimates store model4
	margins, dydx(discussion) at(str_dual_identity= (-95(10)70))
	marginsplot, yline(0)
	esttab model1 model2 model3 model4 using "appendix_n_task3_dual.rtf", replace se b(%9.2f) cons r2 starlevels(* 0.05 ** 0.01 *** 0.001) scalars(ll) sfmt(%9.2f %9.0f %9.2f) nodepvars label addnote("")
	
		